/**
 * Created by Dalyn on 2017/3/16.
 */
import Relay from "react-relay";

export default class UserDetailMutation extends Relay.Mutation {

    static fragments = {};

    getMutation() {
        return Relay.QL`mutation { userDetail }`;
    }

    getVariables() {
        return {
            argsInput: {
                uid:this.props.uid,
            }
        };
    }

    getFatQuery() {
        return Relay.QL`fragment on userDetailPayload {
            userDetail {  
                errorCode
                value
                totalResult
                id
                userModel{
                    name
                    depId
                    depName
                    depName
                    status
                    password
                    phone
                    email
                    enterpriseDomainList{
                                enterpriseName
                                 depName
                                 roleName
                                 roleId
                    }
                }
            }
        }`;
    }

    getConfigs() {
        return [{
            type: 'REQUIRED_CHILDREN',
            children: [Relay.QL`
              fragment on userDetailPayload {
                    userDetail {  
                        errorCode
                        value
                        totalResult
                        id
                        userModel{
                            name
                            depId
                            depName
                            depName
                            status
                            password
                            phone
                            email
                            enterpriseDomainList{
                                 enterpriseName
                                 depName
                                 roleName
                                 roleId
                    
                            }
                        }
                    }
                }
            `]
        }];
    }

}